package jbrowser.services;

import java.util.Properties;
import java.util.Set;

/**
 *
 * Stores and load
 * <code>java.util.Properties</code> config files from/to the default folder.
 * Default folder is ${jbrowser.home}/etc
 * <p>
 * Restricted keywords:
 * <ul>
 * <li> config.file.name = not used
 * <li> config.editor.class.uri = uri to editor class, extends JComponent
 * <li> config.editor.key.name =
 * <li> config.editor.value.name =
 * </ul>
 *
 * @author suse
 */
public interface ConfigurationService extends Service {

    
    public Set<String> getPropertyNames();
    /**
     * Load properties file from the default folder.
     *
     * @param name the file name
     * @return Properties or null if any Exception occurs
     */
    public Properties getProperties(String name);

    /**
     * Load properties file from the default folder.
     *
     * Creates an empty property list with the specified defaults.
     *
     * @param name the file name
     * @param defaults the defaults.
     * @return Properties
     */
    public Properties getProperties(String name, Properties defaults);

    /**
     * Create or replace properties file in the default folder. Default folder
     * is ${jbrowser.home}/etc
     *
     * @param name
     * @param properties
     */
    public void setProperties(String name, Properties properties);

    /**
     * Create or merge properties.
     *
     * @param name
     * @param properties
     */
    public void addProperties(String name, Properties properties);
}
